package com.ruoyi.mongo.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

// 绑定所有以 spring.data.mongodb 为前缀的配置
@Data
@Component
@ConfigurationProperties(prefix = "spring.data.mongodb")
public class MongoCustomProperties {
    // 主数据库配置
    private MongoProperties primary = new MongoProperties();

    // cet4
    private MongoProperties secondary = new MongoProperties();

    //综合练习-高中872
    private MongoProperties comprehensive = new MongoProperties();

    // 内部类，用于接收具体的MongoDB连接信息
    @Data
    public static class MongoProperties {
        private String uri;
        private String database;
        private String host;
        private int port;
        private String username;
        private String password;
    }
}
